<?php

Route::group([
    'namespace' => 'App\Http\Controllers\Api\Qiniu',
    'prefix' => 'common/qiniu',
    'middleware' => ['response', 'auth'],
], function () {
//    Route::post('/upload_file', "QiniuController@uploadFile");
    Route::post('/upload_image', "QiniuController@uploadImage");
    Route::post('/upload_files', "QiniuController@uploadFiles");

});

/**
 * 文件相关
 */
Route::group([
    'namespace' => 'App\Http\Controllers\Base',
    'prefix' => 'common/upload',
//    'middleware' => ['response', 'auth'],
    'middleware' => ['response'],
], function () {
    Route::get('/upload_image', "ImagesController@handelImagesSize");//
    Route::post('file', 'FileController@upload');//上传文件
    Route::post('excel', 'FileController@excel');//上传文件
    Route::post('export', 'FileController@export');//上传文件
    Route::get('export1', 'FileController@export');//上传文件
    Route::post('exportCsv', 'FileController@exportCsv');//上传文件
});

Route::group([
    'namespace' => 'App\Http\Controllers',
    'prefix' => 'common/redis',
    'middleware' => ['response'],
], function () {
    Route::get('/set', "TextController@setRedis");

});

Route::group([
    'namespace' => 'App\Http\Controllers\Api\Agent',
    'prefix' => 'common/agent',
    'middleware' => ['response'],
], function () {
    Route::get('/index', "AgentController@index");
});


//邮件
Route::group([
    'namespace' => 'App\Http\Controllers\Common',
    'prefix' => 'common/mail',
    'middleware' => ['response'],
], function () {
    Route::get('/send', "MailController@sendMail");
});

//excel
Route::group([
    'namespace' => 'App\Http\Controllers\Common\LaravelExcel',
    'prefix' => 'common/excel',
//    'middleware' => ['response'],
], function () {
    Route::post('/imports', "ExcelController@imports")->middleware('response');
    Route::get('/exports', "ExcelController@exports");
});

Route::group([
    'namespace' => 'App\Http\Controllers\Common',
    'prefix' => 'common/index',
//    'middleware' => ['response'],
], function () {
    Route::post('/index', "IndexController@index")->middleware('response');
});
